<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<html>
<head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>
<body>
<c:choose>
	<c:when test="greetings!=null">
		<p>The guestbook has no messages.</p>
	</c:when>
	<c:otherwise>
		<c:forEach items="${greetings}" var="item">
			<p><c:choose>
			<c:when test="${item.author == null}">익명  </c:when>
			<c:otherwise>${item.author.userId} </c:otherwise>
			</c:choose>says. 
			${item.content}</p>
		</c:forEach>
	</c:otherwise>
</c:choose>
<form action="/guestbook/writeArticle.do" method="post">
<div><textarea name="content" row="3" cols="60"></textarea></div>
<div><input type="submit" value="Post Greeting" /></div>
</form>
</body>
</html>